home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / vol_400 / 402_01 / cforms-2.2 / example / input.frm < prev    next >
Encoding:
Text File  |  1993-07-20  |  1.2 KB  |  58 lines

  1. /*
  2.  * Test application for CForms.
  3.  * @(#) input.frm,v 1.4 1993/05/10 22:52:00 lasse Exp
  4.  */
  5.  
  6. Viewport view {
  7.     Pos 0,0;
  8.     Size 80, 23;
  9. }
  10.  
  11. CCode {
  12.     extern int cur_row;
  13. }
  14.  
  15. Event Key DOWN  { fld_move(fld_down(NULL));  }
  16. Event Key UP    { fld_move(fld_up(NULL));    }
  17. Event Key CR    { fld_move(fld_next(NULL)); }
  18. Event Key TAB   { fld_move(fld_next(NULL)); }
  19. Event Key HELP  { message("You're using CForms"); }
  20. Event Key ESC    { pic_leave(); }
  21. Event Key F8    { pic_leave(); }
  22.  
  23. Picture Welcome Viewport View {
  24.  
  25.     Event Draw {
  26.     fld_set(field("name"), fld_get(field("list:name%d", cur_row)));
  27.     fld_set(field("adress"), fld_get(field("list:adress%d", cur_row)));
  28.     }
  29.  
  30.     Event Key ESC { pic_leave(); message("Canceled"); }
  31.  
  32.     Event Key F1 { 
  33.     fld_set(field("list:name%d", cur_row), fld_get(field("name")));
  34.     fld_set(field("list:adress%d", cur_row), fld_get(field("adress")));
  35.     message("Inserted");
  36.     pic_leave();
  37.     }
  38.  
  39.     Literal 25, 1,  "Person registration";
  40.     Literal +0, +1, "-------------------";
  41.  
  42.     Field name {
  43.     Pos 20, 5;
  44.     Type Char(20);
  45.     LValue "Name: ";
  46.     Uppercase;
  47.     }
  48.  
  49.     Field adress {
  50.     Pos 20, 7;
  51.     Type Char(20);
  52.     LValue "Adress: ";
  53.     Uppercase;
  54.     }
  55.  
  56.     Literal Center, Max, "(F1 - Update)    (ESC - Leave)";
  57. }
  58.